package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"todo-demo/cfg"
	"todo-demo/routers"
)

func main() {

	gin.ForceConsoleColor()

	r := gin.Default()
	r.LoadHTMLGlob("templates/**/*")

	r.GET("/ping", func(c *gin.Context) {
		c.String(200, "Pong")
	})
	fmt.Println("http://localhost:9999/todo")
	routers.TodoRouterInit(r)

	err := r.Run(cfg.SERVER_PORT)
	if err != nil {
		fmt.Println("start server catch error as :", err.Error())
	}

}
